/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: COFFEEWEN
 * Date: 2022-08-12
 * Time: 12:10
 */
public class Test {
    public static void main(String[] args) {
        String str = "name=zhangsan&age=18" ;
        String[] result = str.split("&") ;
        for (int i = 0; i < result.length; i++)
        {
            String[] temp = result[i].split("=") ;
            System.out.println(temp[0]+" = "+temp[1]);
        }
    }
}
